
import { Tensor, TensorDataType, TensorShape } from "../Tensor";

export enum AllocScope {
    LayerOutPut,
    InternalToLayer,
}

export abstract class ITensorAllocator {
    abstract reset(arg0: boolean): unknown;
    alloc(shape: TensorShape, scope: AllocScope = AllocScope.LayerOutPut, dataType: TensorDataType = TensorDataType.Float): Tensor {
        return new Tensor();
    }

}

/**
 * @en
 * Interface for device dependent representation of Tensor data.
 * @zh
 * Tensor 数据的设备相关表示的接口。
 */
export interface ITensorData {


    upload(data: number[], shape: TensorShape, managedBufferStartIndex: number): void;

    download(shape: TensorShape): number[];

}